﻿using CNKI.TPI.Web.Admin.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace CNKI.TPI.Web.Admin.IDAO
{
    public interface ISubjectHomeDao
    {
        /// <summary>
        /// 根据查询条件获取专题分页数据
        /// </summary>
        /// <param name="match"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC> GetTopicByWherePageSize(string name, int start, int length, out int count);
        /// <summary>
        /// 添加专题
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool InsertTopic(SYS_CMS_TOPIC obj);
        /// <summary>
        /// 更新专题
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateTopic(SYS_CMS_TOPIC obj);
        /// <summary>
        /// 删除专题
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        bool DeleteSubject(string sysidstr);
        /// <summary>
        /// 根据查询条件获取导航分类数据
        /// </summary>
        /// <param name="match"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS> GetNavByWherePageSize(string name, int start, int length, out int count);
        /// <summary>
        /// 添加专题
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool InsertNav(SYS_CMS_TOPIC_CLS obj);

        bool InsertDB(SYS_CMS_TOPIC_DBCONFIG obj);
        /// <summary>
        /// 更新专题
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateNav(SYS_CMS_TOPIC_CLS obj);

        bool UpdateDB(SYS_CMS_TOPIC_DBCONFIG obj);
        /// <summary>
        /// 删除专题
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        bool DeleteNav(string sysidstr);

        bool DeleteDB(string sysidstr);

        /// <summary>
        /// 根据查询条件获取数据源分类数据
        /// </summary>
        /// <param name="match"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_DBCONFIG> GetDBByWherePageSize(string name, int start, int length, out int count);

        /// <summary>
        /// 根据专题查询专题数据
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC> GetSubjectByName(string name);

        /// <summary>
        /// 根据导航名称查询导航数据
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS> GetNavByName(string name);

        /// <summary>
        /// 根据数据源名称查询导航数据
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_DBCONFIG> GetDBByName(string name);
        IList<SYS_CMS_TOPIC_DBCONFIG> GetDBBySysId(string sysid);
        /// <summary>
        /// 添加分类
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool InsertTopicClsNode(SYS_CMS_TOPIC_CLS_NODE obj);

        /// <summary>
        /// 更新分类
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateTopicClsNode(SYS_CMS_TOPIC_CLS_NODE obj);

        /// <summary>
        /// 删除分类及子分类
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        bool DeleteCateNode(string sysidstr,string clscode);
        /// <summary>
        /// 根据导航编码删除分类
        /// </summary>
        /// <param name="clscode"></param>
        /// <returns></returns>
        bool DeleteByClsCode(string clscode);
        /// <summary>
        /// 根据条件查询分类数据
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns> 
        IList<SYS_CMS_TOPIC_CLS_NODE> GetCateByNavCode(string code);

        /// <summary>
        /// 获取下一个分类编码
        /// </summary>
        /// <param name="clscode"></param>
        /// <param name="parentcode"></param>
        /// <param name="grade"></param>
        /// <returns></returns>
        string GetNextCateCode(string clscode, string parentcode, int grade);
        /// <summary>
        /// 更新叶子结点标志
        /// </summary>
        /// <param name="clscode"></param>
        /// <param name="syscode"></param>
        /// <param name="flage"></param>
        /// <returns></returns>
        bool UpdateNavCateChild(string clscode, string syscode, int flage);

        /// <summary>
        /// 更新分类名称
        /// </summary>
        /// <param name="sysid"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        bool UpdateTopicClsNodeName(int sysid, string name);

        /// <summary>
        /// 添加分类条件
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool InsertTopicQuery(SYS_CMS_TOPIC_CLS_QUERY obj);

        /// <summary>
        /// 编辑条件
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateTopicQuery(SYS_CMS_TOPIC_CLS_QUERY obj);
        /// <summary>
        /// 根据查询条件获取分类条件数据
        /// </summary>
        /// <param name="match"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS_QUERY> GetQueryByPageSize(string dbname, string nodecode,string navcode, int start, int length, out int count);
        /// <summary>
        /// 删除分类条件
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
        bool DeleteCateQuery(string sysidstr);
        /// <summary>
        /// 根据分类编码删除分类条件
        /// </summary>
        /// <param name="clscode"></param>
        /// <returns></returns>
        bool DelCateQueryByClsCode(string clscode);
        /// <summary>
        /// 根据条件获取数据SYS_CMS_TOPIC_CLS_QUERY
        /// </summary>
        /// <param name="match"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_CLS_QUERY> GetQueryByDBNode(string dbcode, string nodecode);
        IList<SYS_CMS_TOPIC_CLS_QUERY> GetQueryByCLSCode(string nodecode,string clscode);
        IList<SYS_CMS_TOPIC_CLS_NODE> GetByCLSNodeCode(string clscode, string nodecode);
        
        /// <summary>
        /// 根据查询条件获取SYS_CMS_TOPIC_PAGECONFIG数据
        /// </summary>
        /// <param name="match"></param>
        /// <param name="start"></param>
        /// <param name="length"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        IList<SYS_CMS_TOPIC_PAGECONFIG> GetPageConfigByPageSize(string columname, string topiccode, int start, int length, out int count);

         /// <summary>
         /// 添加
         /// </summary>
         /// <param name="obj"></param>
         /// <returns></returns>
          bool InsertPageConfig(SYS_CMS_TOPIC_PAGECONFIG obj);
        
         /// <summary>
         /// 编辑
         /// </summary>
         /// <param name="obj"></param>
         /// <returns></returns>
          bool UpdatePageConfig(SYS_CMS_TOPIC_PAGECONFIG obj);
          IList<SYS_CMS_TOPIC_PAGECONFIG> GetPageConfig(string sysid);
          bool DeletePageConfig(string sysidstr);
         /// <summary>
        /// 修改显示顺序
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
          bool UpdatePageSort(IList<SYS_CMS_TOPIC_PAGECONFIG> list);
          /// <summary>
        /// 获取子节点
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
          IList<SYS_CMS_TOPIC_CLS_NODE> GetCateChilds(string clscode, int grade, string syscode);
          IList<SYS_CMS_TOPIC_PAGECONFIG> GetPageConfigAll();
        /// <summary>
          /// 根据sysid获取SYS_CMS_TOPIC_CLS数据
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
          IList<SYS_CMS_TOPIC_CLS> GetBySysIDStr(string sysidstr);
        
        /// <summary>
        /// 根据专题编码删除栏目设置
        /// </summary>
        /// <param name="topicCode"></param>
        /// <returns></returns>
        bool DelageConfigByTopicCode(string topicCode);
        /// <summary>
        /// 获取专题数据
        /// </summary>
        /// <param name="sysidstr"></param>
        /// <returns></returns>
           IList<SYS_CMS_TOPIC> GetSubject(string sysidstr);
        /// <summary>
        /// 根据nodecode和clscode删除条件
        /// </summary>
        /// <param name="clscode"></param>
        /// <param name="sysnodecode"></param>
        /// <returns></returns>
           bool DelQueryByClsNodeCode(string clscode, string sysnodecode);
       
    }
}
